package com.asen.alibaba.service;

import com.alibaba.csp.sentinel.slots.block.BlockException;

/**
 * @ClassName ExceptionUtil
 * @Deacription TODO
 * @Author chenxin
 * @Date 2021/3/24 16:37
 *
 * 注意事项：
 * 1、参数必须一致、BlockException接收异常信息
 **/
public class CustomerFallBackHandler {

    public static String handleException(BlockException blockException) {
        System.out.println("被限流，无法访问接口");
        return "被限流，无法访问接口";
    }

    public static String fallbackException(Throwable throwable) {
        System.out.println("熔断功能被开启");
        return "熔断功能被开启";
    }
}
